package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BayonetMapper;
import com.ruoyi.system.domain.Bayonet;
import com.ruoyi.system.service.IBayonetService;
import com.ruoyi.common.core.text.Convert;

/**
 * 卡口信息Service业务层处理
 * 
 * @author zbb
 * @date 2023-02-13
 */
@Service
public class BayonetServiceImpl implements IBayonetService 
{
    @Autowired
    private BayonetMapper bayonetMapper;

    /**
     * 查询卡口信息
     * 
     * @param bayonetId 卡口信息主键
     * @return 卡口信息
     */
    @Override
    public Bayonet selectBayonetByBayonetId(Long bayonetId)
    {
        return bayonetMapper.selectBayonetByBayonetId(bayonetId);
    }

    /**
     * 查询卡口信息列表
     * 
     * @param bayonet 卡口信息
     * @return 卡口信息
     */
    @Override
    public List<Bayonet> selectBayonetList(Bayonet bayonet)
    {
        return bayonetMapper.selectBayonetList(bayonet);
    }

    /**
     * 新增卡口信息
     * 
     * @param bayonet 卡口信息
     * @return 结果
     */
    @Override
    public int insertBayonet(Bayonet bayonet)
    {
        bayonet.setCreateTime(DateUtils.getNowDate());
        return bayonetMapper.insertBayonet(bayonet);
    }

    /**
     * 修改卡口信息
     * 
     * @param bayonet 卡口信息
     * @return 结果
     */
    @Override
    public int updateBayonet(Bayonet bayonet)
    {
        bayonet.setUpdateTime(DateUtils.getNowDate());
        return bayonetMapper.updateBayonet(bayonet);
    }

    /**
     * 批量删除卡口信息
     * 
     * @param bayonetIds 需要删除的卡口信息主键
     * @return 结果
     */
    @Override
    public int deleteBayonetByBayonetIds(String bayonetIds)
    {
        return bayonetMapper.deleteBayonetByBayonetIds(Convert.toStrArray(bayonetIds));
    }

    /**
     * 删除卡口信息信息
     * 
     * @param bayonetId 卡口信息主键
     * @return 结果
     */
    @Override
    public int deleteBayonetByBayonetId(Long bayonetId)
    {
        return bayonetMapper.deleteBayonetByBayonetId(bayonetId);
    }
}
